/*
Copyright (C) 2022-2024 Inspur Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/
package model

type CredentialResponse struct {
	RequestId string `json:"requestId"`
}

type CredentialDetail struct {
	Credential *Credential `json:"credential"`
	TxId       string      `json:"txId"`
}

type Credential struct {
	Context           []string          `json:"@context"`
	CptId             string            `json:"cptId"`
	Id                string            `json:"id"`
	Type              string            `json:"type"`
	Issuer            string            `json:"issuer"`
	IssuanceDate      string            `json:"issuanceDate"`
	ExpirationDate    string            `json:"expirationDate"`
	CredentialSubject CredentialSubject `json:"credentialSubject"`
	Revocation        VcRevocation      `json:"revocation"`
	Proof             VcProof           `json:"proof"`
}

type CredentialSubject struct {
	Id     string `json:"id" validate:"required"`
	Claims string `json:"claims" validate:"required"`
}

type VcRevocation struct {
	Id   string `json:"id"`
	Type string `json:"type"`
}

type VcProof struct {
	Creator        string `json:"creator"`
	Type           string `json:"type"`
	SignatureValue string `json:"signatureValue,omitempty"`
}

type CredentialInfo struct {
	CredentialId   string `json:"credentialId"`
	CredentialName string `json:"credentialName"`
	IssuerName     string `json:"issuerName,omitempty"`
	IssuerDid      string `json:"issuerDid,omitempty"`
	CptId          string `json:"cptId,omitempty"`
	Status         string `json:"status,omitempty"`
	RevokeDate     string `json:"revokeDate,omitempty"`
	RevokeReason   string `json:"revokeReason,omitempty"`
	CreatedTime    string `json:"createdTime"`
	UpdatedTime    string `json:"updatedTime"`
}

type CredentialClaims struct {
	Claims string `json:"claims"`
}

type GrantInfo struct {
	CredentialId   string `json:"credentialId"`
	OwnerId        string `json:"ownerId"`
	OwnerDid       string `json:"ownerDid"`
	Grantee        string `json:"grantee"`
	CredentialName string `json:"credentialName"`
	IssuerName     string `json:"issuerName"`
	GrantDate      string `json:"grantDate"`
	ExpirationDate string `json:"expirationDate"`
}
